home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 43.zip / Guru Crackers Utilities.adf / decruncher.s < prev    next >
Text File  |  1987-06-04  |  2KB  |  147 lines

  1. ; decruncher
  2.  
  3. read  = $34028    ; set end addr of your crunched file
  4. ; current adress is the one of an hires page called PAGE.CR
  5. ; if you want to test the decruncher use showmem at $30000
  6. ; load PAGE.CR at $30000 (command RI),assemble then
  7. ; type G S and watch in the memory
  8.  
  9. lowwr = $30000    ; set destination address
  10.  
  11. s:
  12. lea read,a0
  13. lea lowwr,a1        
  14. move.l -(a0),a2        
  15. add.l a1,a2        
  16. move.l -(a0),d5        
  17. move.l -(a0),d0        
  18. eor.l d0,d5        
  19.  
  20. notfinished:
  21. lsr.l #1,d0
  22. bne.S notempty1
  23. jsr getnextlwd
  24. notempty1:
  25. bcs.S bigone        
  26.  
  27. moveq #8,d1    
  28. moveq #1,d3    
  29. lsr.l #1,d0
  30. bne.S notempty2
  31. jsr getnextlwd
  32. notempty2:
  33. bcs.S dodupl    
  34.  
  35. moveq #3,d1    
  36. clr.w d4    
  37.  
  38. dojmp:        
  39.         
  40. jsr rdd1bits    
  41. move.w d2,d3    
  42. add.w d4,d3    
  43.  
  44. getd3chr:
  45.  
  46. moveq #7,d1    
  47. get8bits:
  48. lsr.l #1,d0
  49. bne.S notempty3
  50. jsr getnextlwd
  51. notempty3:
  52. roxl.l #1,d2
  53. dbf d1,get8bits    
  54.  
  55. move.b d2,-(a2)
  56. dbf d3,getd3chr    
  57. jmp nextcmd
  58.  
  59. bigjmp:
  60. moveq #8,d1    
  61. moveq #8,d4    
  62.         
  63.         
  64.         
  65. jmp dojmp
  66.  
  67. bigone:
  68. moveq #2,d1    
  69. jsr rdd1bits
  70. cmp.b #2,d2    
  71. blt.S midjumps    
  72. cmp.b #3,d2    
  73. beq.S bigjmp    
  74.  
  75.  
  76. moveq #8,d1    
  77. jsr rdd1bits    
  78. move.w d2,d3    
  79. move.w #12,d1    
  80. jmp dodupl    
  81.  
  82. midjumps:
  83. move.w #9,d1    
  84. add.w d2,d1
  85. addq #2,d2
  86. move.w d2,d3    
  87.  
  88. dodupl:
  89. jsr rdd1bits    
  90.         
  91.         
  92. copyd3bytes:
  93. subq #1,a2
  94.  
  95. move.b (a2,d2.w),(a2)
  96.  
  97. dbf d3,copyd3bytes
  98.  
  99. nextcmd:
  100. cmp.l a2,a1
  101. blt.L notfinished
  102. tst.l d5
  103. bne.S damage
  104. illegal
  105.  
  106. damage:
  107. move.w #$ffffffff,d0
  108. damloop:
  109. move.w d0,$dff180
  110. subi.l #1,d0
  111. bne.S damloop
  112. illegal
  113.  
  114.  
  115. getnextlwd:
  116. move.l -(a0),d0
  117. eor.l d0,d5
  118. move.w #$10,ccr
  119. roxr.l #1,d0
  120. rts
  121.  
  122. rdd1bits:    
  123. subq.w #1,d1
  124. clr.w d2
  125.  
  126. getbits:
  127. lsr.l #1,d0
  128. bne.S notempty
  129. move.l -(a0),d0
  130. eor.l d0,d5
  131. move.w #$10,ccr
  132. roxr.l #1,d0
  133.  
  134. notempty:
  135. roxl.l #1,d2
  136. dbf d1,getbits
  137. rts
  138.  
  139. ; Written by LORD BLITTER
  140.  
  141. ; Christian MORANT
  142. ; 8, av. des Pagodes
  143. ; 1020 Brussels
  144. ; Belgium
  145.  
  146. ; official dealer : BS1
  147.